const fp = require("lodash/fp");

const obj = { age: 18 };
const result = fp.update("age", num => num + 1, obj);
console.log(obj, result);

const config = { headers: { token: "abc" }, params: { foo: 42, language: "en-US" } };
let newConfig = fp.update("headers", fp.set("Accept-Language", "zh-CN"), config);
newConfig = fp.update("params", fp.set("language", "zh-CN"),  newConfig);

console.log("\nconfig:", config);
console.log("newConfig:", newConfig);
